package controller;

import java.io.FileInputStream;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;

import settings.PathSettings;

public class ConfigurationController {

	private static ConfigurationController instance = new ConfigurationController();
	private Properties properties = new Properties();

	private ConfigurationController() {

		try {
			properties.load(new FileInputStream(PathSettings.CONTROLLER_CONFIGURATION_CONTROLLER));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static ConfigurationController instance() {
		return instance;
	}

	public String getProperty(String property) {
		return properties.getProperty(property);
	}
	
	public String getProperty(String property,String... args) {
		MessageFormat format = new MessageFormat(properties.get(property).toString());
		return format.format(args);
		
	}

}
